﻿using System;
using System.Windows.Forms;

namespace MarioMapEditor
{
    public partial class FormRua : Form
    {
        private readonly MainForm _mParent;
        private readonly int _selectedID;
        private int _info;

        public FormRua(MainForm mparent, int selected)
        {
            _mParent = mparent;
            _selectedID = selected;
            _info = (int)ObAcEnemy1.RUAINFO.LV1_LEFT;
            InitializeComponent();
            comboBox2.SelectedIndex = 0;
        }

        private void Button1Click(object sender, EventArgs e)
        {
            _mParent.CreateActiveOb(_selectedID, _info);
            Close();
        }

        private void ComboBox2SelectedIndexChanged(object sender, EventArgs e)
        {
            switch (comboBox2.SelectedIndex)
            {
                case 0:
                    _info = (int)ObAcEnemy1.RUAINFO.LV1_LEFT;
                    break;
                case 1:
                    _info = (int)ObAcEnemy1.RUAINFO.LV1_RIGHT;
                    break;
                case 2:
                    _info = (int)ObAcEnemy1.RUAINFO.LV2_LEFT;
                    break;
                case 3:
                    _info = (int)ObAcEnemy1.RUAINFO.LV2_RIGHT;
                    break;
                default:
                    _info = (int)ObAcEnemy1.RUAINFO.LV1_LEFT;
                    break;
            }
        }

    }
}
